Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TEST ONLY: Combined ZoneJS changes for g3 testing #36043

Closed

Conversation

AndrewKushnir
Copy link
Contributor

!!! DO NOT MERGE !!!

This PR is a combination of 4 ZoneJS PRs that are in the merge queue (in old -> new order):

The goal of this PR is to run all affected tests in g3 with all ZoneJS changes.

Monkey patch `MessagePort.prototype.onmessage` and `MessagePort.prototype.onmessageerror` to make
these properties's value(callback function) run in the zone when these value are set.
…ght promise rejection

Close angular#27840.

By default, `zone.js` wrap uncaught promise error and wrap it to a new Error object with some
additional information includes the value of the error and the stack trace.

Consider the following example:

```
Zone.current
  .fork({
    name: 'promise-error',
    onHandleError: (delegate: ZoneDelegate, current: Zone, target: Zone, error: any): boolean => {
      console.log('caught an error', error);
      delegate.handleError(target, error);
      return false;
    }
}).run(() => {
  const originalError = new Error('testError');
  Promise.reject(originalError);
});
```

The `promise-error` zone catches a wrapped `Error` object whose `rejection` property equals
to the original error, and the message will be `Uncaught (in promise): testError....`,
You can disable this wrapping behavior by defining a global configuraiton
`__zone_symbol__DISABLE_WRAPPING_UNCAUGHT_PROMISE_REJECTION = true;` before importing `zone.js`.
…ion API

`zone.js` added `removeAllListeners` and `eventListeners` methods in `EventTarget.prototype`, but those methods only exists when user import `zone.js` and also enables `EventTarget` monkey patching.

If user:
1. Does not import `zone.js` and uses `noop` zone when bootstrapping Angular app. OR
2. Disable monkey patching of `EventTarget` patch by defining `__Zone_disable_EventTarget = true`.

Then `removeAllListeners` and `eventListeners`  methods will not be present.
Close angular#31687, angular#31684

Zone.js patches rxjs internal `_subscribe` and `_unsubscribe` methods, but zone.js doesn't do null check, so in some operator such as `retryWhen`, the `_unsubscribe` will be set to null, and will cause
zone patched version throw error.

In this PR, if `_subscribe` and `_unsubscribe` is null, will not do the patch.
@ngbot ngbot bot added this to the needsTriage milestone Mar 12, 2020
@googlebot
Copy link

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

@googlebot
Copy link

A Googler has manually verified that the CLAs look good.

(Googler, please make sure the reason for overriding the CLA status is clearly documented in these comments.)

ℹ️ Googlers: Go here for more info.

@AndrewKushnir
Copy link
Contributor Author

AndrewKushnir commented Mar 12, 2020

@AndrewKushnir AndrewKushnir added the action: presubmit The PR is in need of a google3 presubmit label Mar 12, 2020
@AndrewKushnir
Copy link
Contributor Author

Update: global TAP run looks good, the mentioned PRs will be merged into master on Monday.

@AndrewKushnir
Copy link
Contributor Author

Combined set of ZoneJS changes were tested in g3 (using Global TAP run), the run was successful. Corresponding PRs are now merged and I'm closing this PR.

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Apr 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: presubmit The PR is in need of a google3 presubmit area: zones cla: yes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants